<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增心理测试')" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-psychologicaTest-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="name" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">描述：</label>
                <div class="col-sm-8">
                    <input id="description" name="description" type="hidden">
                    <div class="ibox-content no-padding">
                        <div class="summernote" id="content">

                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">类型：</label>
                <div class="col-sm-8">
                    <select id="type" name="type" class="form-control m-b selectpicker" th:with="type=${@dict.getType('sc_psychologica_type')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: summernote-js" />
    <script type="text/javascript">
        var prefix = ctx + "school/psychologicaTest"
        $("#form-psychologicaTest-add").validate({
            focusCleanup: true
        });
        $(document).ready(function () {
            $('.summernote').summernote({
                lang: 'zh-CN',
                height: 100
            });
        });
        function submitHandler() {
            $("#description").val($('#content').summernote('code'));
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-psychologicaTest-add').serialize());
            }
        }
    </script>
</body>
</html>